home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlb20 / lib / perror.c < prev    next >
C/C++ Source or Header  |  1991-10-19  |  371b  |  25 lines

  1. /* originally from Dale Schumacher's dLibs */
  2.  
  3. /*
  4.  * standard "print error message" function
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <errno.h>
  9.  
  10. extern char *strerror();
  11.  
  12.  
  13. void perror(msg)
  14.     const char *msg;
  15.     {
  16.     if(msg && *msg)
  17.         {
  18.         fputs(msg, stderr);
  19.         fputs(": ", stderr);
  20.         }
  21.     if(msg = strerror(errno))
  22.         fputs(msg, stderr);
  23.     fputs(".\n", stderr);
  24.     }
  25.